//
//  SRDeviceInfo.h
//  sr01sdkProject
//
//  Created by  on 2022/5/25.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, CA_DEV_COLOR) {
    CA_DEV_COLOR_DARK = 0x00,       // 黑色(Black)
    CA_DEV_COLOR_SILVER = 0x01,     // 银色(Silver)
    CA_DEV_COLOR_GOLD = 0x02,       // 金色(Gold)
    CA_DEV_COLOR_ROSE_GOLD = 0x03,  // 玫瑰金(Rose Gold )
    
    CA_DEV_COLOR_Silver_Gold_Mixed = 0x04, //银/金混色(Silver/Gold Mixed)
    CA_DEV_COLOR_Gold_Silver_Mixed = 0x05, //金/银混色(Gold/Silver Mixed)
    CA_DEV_COLOR_Champagne_Gold_Silver_Mixed = 0x06, //香槟金/银混色(Champagne Gold/Silver Mixed)
    CA_DEV_COLOR_Rose_Gold_Silver_Mixed = 0x07,//玫瑰金/银混色(Rose Gold/Silver Mixed)
    CA_DEV_COLOR_Brushed_Silver = 0x08,//拉丝银(Brushed Silver )
    CA_DEV_COLOR_Stealth = 0x09,//黑色磨砂(Stealth)
    CA_DEV_COLOR_Gun_Color = 0x0A, // 深灰(Dark Gray)
};

typedef NS_ENUM(NSInteger, CA_MAIN_CHIP_TYPE) {
    CA_MAIN_CHIP_14531_00 = 0,
    CA_MAIN_CHIP_14531_01 = 1,
    CA_MAIN_CHIP_14592 = 2, // sr23
    
}; // 主芯片型号


typedef NS_ENUM(NSUInteger, CA_CMD_EXECTE_ERROR_REASON) {
    CA_REASON_NONE = 0,
    CA_REASON_1, // 设备自动测量中
    CA_REASON_2, // 设备在运动模式测量中
    CA_REASON_3, // 设备app测量中
    CA_REASON_4, // 参数错误
    CA_REASON_5, // 不支持指令的执行,或 当前设备状态不支持 - 例如已开始锻炼,再下发锻炼
};

typedef NS_ENUM(uint8_t, CA_ECG_CALC_TYPE) {
    CA_ECG_CALC_ON_DEVICE = 0,
    CA_ECG_CALC_ON_NET = 0x01,
};

typedef NS_ENUM(NSUInteger, CA_RING_PROJECT_ID) {
    CA_PROJ_NOT_SUPPORT = 0, //旧的设备版本 不支持此参数
    CA_PROJ_SR03 = 0x10,//项目:0x10 (00010000)
    CA_PROJ_SRO9W = 0x20  ,//无线充电: 0x20(00100000)
    CA_PROJ_SRO9N = 0x21 ,//NFC 充电: 0x21(00100001)
    CA_PROJ_SR01A = 0x22 ,//项目:0x22(00100010)
    CA_PROJ_SR23_NFC = 0x30 ,//NFC 充电: 0x30 (00110000)
    CA_PROJ_SR28_NFC = 0x31 ,//NFC 充电, 挪威算法,ecg云端
    CA_PROJ_SR26 = 0x40 ,//低成本戒指项目:0x40(01000000)
};


@interface CADeviceInfo : NSObject
@property(assign, nonatomic, readonly)CA_DEV_COLOR color;
@property(assign, nonatomic, readonly)NSUInteger size;

@property(strong, nonatomic, readonly)NSString *softWareVersion;
@property(strong, nonatomic, readonly)NSString *bleMacAddress;


@property(assign, nonatomic, readonly)int generation;//2023-7-26

@property(assign, nonatomic, readonly)uint8_t chargeType;//2023-7-26
@property(assign, nonatomic, readonly)BOOL needOemAuth;
@property(assign, nonatomic, readonly)BOOL supportSportmode; //2023-7-26

@property(assign, nonatomic, readonly)CA_ECG_CALC_TYPE ecgCalcType;
@property(assign, nonatomic, readonly)BOOL isSelfDevelopedAlgorithm; // NO = 三方算法, YES=凌拓算法

@property(assign, nonatomic, readonly)BOOL supportEcg;// 2024-4-20 是否支持ecg功能
@property(assign, nonatomic, readonly)uint8_t projectId;

- (instancetype)initWithData:(NSData *)data;


@end

NS_ASSUME_NONNULL_END
